package com.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id ="2021000119652898";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key ="MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCLZvG7miDx4gssO77yYfjr7B5skv3oayjMV1e4YfDUddGhSh+OpnzWDjNJwkxxjuM1cXgcW4CPfcSx/KfYZmfqlYY9LSaQ2rdYVFGYo1ZjqW1q8eZkEKbNRzu40/9PmnJj2w/W3SFYsEt9ibcLZ7QAM6edKRFaIL7jlYzYEGIuOvrwrowO+Jye8YiLqyG/n+/gFfGwcEugtIAWQuYGYmCmZZjEDgdAHgvAIYHB6sxEin7vhFRbOQNeSjTpRi+vg2lNgaZYORDcAyWjASzYKrLIng0pxVYHhUN3T67jQq4RGgmlXY41v6cA2+MeKKr2wfu5JuYberxjmYCGd6oXvlR9AgMBAAECggEASgA99t7c+kqKr9KPjM/heiwAApcNXqH0KHV9RY4IcGCTBdH5apqKzn7/Tvpr5iR6DNbNchBI8ONM1UdQOpoyM99oQXWEcYUJq0QnhKXAqGs6gHklWp1UTsivtXAkqjdM3iFeCSueFhyQFnZSyyUj8q95HP6+DWAwtVOgTtpzpCI2mERSwzv4jin0yRF59/O0UZc8067Or4moSINx9tSGEsdevKXXZuYE6JQaz7w8oBQcobD1kyH8AAv7BVIXFYqkZkYqmO0eLo9dKglBgR55c4xfKWu+AAd30ZTz41WMi2SXmGjFpwQwv+tH2DfjcyzYcHl3suPfz/WxlCflkYHlKQKBgQDAAT8NrpFco9i8chTqIkrCJc5/sMitr2wWc46pB2I5S7sEO23EAapg9hISM8xqfkKkFbWqfI6dYvj2jENipLCuSnfbxEKTCzdv1VtUiwsUq6Qgx8MVqd7hwC/vqQu+mgNrhwQDwheGviV95X/Oc0xy7KQS8zfy3SClEUTAssRT2wKBgQC53WLJEWXS7YYuSIvg3OHxinPX0WM5lesBhvM1T9Y3/UbzVvPLlyAP4AZu+3ychZ/A6AqgIGT4dWEV+HyM97zF++G1+yUbOso9kiT4/9hpx6JpX/EYh2fWC2McKY8p+PiaSOiDyV50f8mLNZIvZB/t3VkK1+Fmhq6IeHDBB8sUhwKBgAGigRTuvZIaWwgPuJndvOE2TTHNIYhJDBSM21QZGf7+5BK/JsoacYbt0W2SP1VQyeR3wto2wUgZxaDjxNccK9zwCWE3pJF38PrkyChKHsgIRhd5W/HdRmaJql7SA6WVzh2mQqR9jJG7ILqXr6TkWmxIE4WNyJYqx9Jf+UPiwcUtAoGAYRX0OOUelAxAT8LTVhTq7NmOY0hblUPrKrQMLGfUlRB21DsyQ8FgHQq/MY+p6rSd2w0aJ8RkGahumyReIuBxOdW1c/KI0m1mIL1LFMnHiJGgE3zrGg34vkTac2Z+AsWrTiQRWG2CKkZpx46nGpwpVX2OumxDr+NgHacT9rCUctcCgYBNY0ySve1EZNg4s4X1tAuLZGw6x1GsEeBJsT2cGLcP5rvwkSnSMz8CRoKUdadTmUh6Q5VeqpfcyXZzQr0Sc0udH3e3dPxzwIL7jxHT8eB0NiB5Kb3+5lQB5RtZvMEE0O8dCdSbxqxlhrnae69FWOuAqE/fz2c0/PeDeyKblTs11g==";

	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoOzBCnbLLPBoO1lZEEjbdjzDfq8JwVMkrJTbIThABQSO9fbKRm/ZYTRbmYKYjQXJ23hGEnvvaFUmWzwf0+XmpJ/PsQqB5G92mIj6/ORgkkHGC3FkeBkg2mYmEHUxJ4zoqR1ZjdeR/bnlEZ9BmhweYK2a5hs+Gf6FLL5H+Apc8jdZd8iKQ++mlyOA+ZP0+s8nuz97Yx/pd47iajJ6Ph5W8lCdMoKKzwEVPjh73GuNSKfkNAoqsUDnMDaipOO/HCoSthSVHEcRjW3Vr7tOnmP7M5tMV1FXyhLYmXjkX9B725BZfzkLVuYAzDlYyQA6y936ztrkXxXADybHtVlrYwDZlQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://qmzqmz.natappfree.cc/fundPath/rechargeRecord/addinfo";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8080/#/main";


	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

